package com.artfii.fluentsql.core;

import com.artfii.fluentsql.core.tools.StringKit;

/** 数据表字段的拼写风格 **/
public enum TableFieldSpell {
    UNDERLINE, LOWCASE, UPCASE, CAMEL, NONE;

    public String trans(String txt) {
        if (this == NONE) {
            return txt;
        }
        if (this == UNDERLINE) {
            return StringKit.toUnderline(txt);
        }
        if (this == LOWCASE) {
            return txt.toLowerCase();
        }
        if (this == UPCASE) {
            return txt.toUpperCase();
        }
        if (this == CAMEL) {
            return StringKit.toCamel(txt);
        }
        return txt;
    }
}
